#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
string lst[1000];
int K = 5, N = 50;
int main()
{
    freopen("lst.out","w",stdout);
    for(int i = 0; i < K; i++) 
        lst[i] = "0", lst[i][0] += i;
    for(int i = K; i < N; i++){
        lst[i] = ""; 
        for(int j = i-1; j >= 0; j-= K) lst[i] += lst[j];
    } 
    for(int i = 0; i < N; i++) cout << lst[i] << endl;
    return 0;
    
}
